package th;

/**
 * @author Mark
 * @version 1.0
 * @date 2020/5/24 10:23
 * @description 线程合并(插队概念)
 */
public class ThreadJoin implements Runnable {

    public static void main(String[] args) throws InterruptedException {
        ThreadJoin threadJoin = new ThreadJoin();
        Thread thread = new Thread(threadJoin);
        thread.start();

        for (int i = 0; i < 1000; i++) {
            if (i == 200) {
                thread.join();
            }
            System.out.println("main = " + i);

        }
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("vip is coming = " + i);
        }
    }
}


